/*
 * @Author: lll 1280388921@qq.com
 * @Date: 2025-06-14 00:37:38
 * @LastEditors: lll 1280388921@qq.com
 * @LastEditTime: 2025-06-17 23:21:54
 * @FilePath: /lesson42/2.tcp/main.cc
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#include "TcpServer.hpp"
#include<iostream>
#include<memory>

using namespace std;

void Usage(string proc)
{
    cout << "\n\rUsage: " << proc << " port[1024+]\n"<< endl;
}

//./tcpServer 8888
int main(int argc,char*argv[])
{
    if(argc!=2)
    {
        Usage(argv[0]);
        exit(UsageError);
    }
    uint16_t port=stoi(argv[1]);
    unique_ptr<TcpServer> tcpsvr(new TcpServer(port));
    tcpsvr->InitServer();
    tcpsvr->Start();

    return 0;
}